package com.example.discover.viewmodel

import android.util.Log
import androidx.lifecycle.LiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.asLiveData
import com.example.discover.repository.BookRepository
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class BookSummaryViewModel @Inject constructor(private val repository: BookRepository): ViewModel() {

    init {
        Log.i("BookSummaryViewModel","***BookSummaryViewModel instance is created***")
    }

    val bookCount : LiveData<Int> by lazy {
        repository.bookCount().asLiveData()
    }
}